﻿@model List<DevWeb.Biztalk.DeploymentSettings.WebUI.Models.IntegrationViewModel>


@using GridMvc.Html
@helper  RenderActions(DevWeb.Biztalk.DeploymentSettings.WebUI.Models.IntegrationViewModel obj){
    @Html.ActionLink("VersionInformation", "Index", "IntegrationVersion", new { id = obj.Id }, new { @class = "btn btn-info btn-xs" })
    <br />
    @Html.ActionLink("Edit", "Edit", new { id = obj.Id }, new { @class = "btn btn-default btn-xs" })
}

@{
    ViewBag.Title = "Index Integrations";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New Integration", "CreateIntegration", "Integration", new {@class="btn btn-primary"}) 
     @Html.ActionLink("Import IntegrationVersion File", "ImportFile", "Integration", new { @class = "btn btn-default" })
</p>
@if (Model.Count > 0)
{
    
    
    @Html.Grid(Model).Named("IntegrationGrid").Columns(columns =>
          {
              columns.Add(m => m.Name).Titled("Integration Name").SetWidth(110).Filterable(true).Sortable(true);
              columns.Add(m => m.Description).Titled("Description").Filterable(true).Sortable(true);
              columns.Add(m => m.ProductUpgradeCode).Titled("ProductUpgradeCode").Filterable(true).Sortable(true);
              columns.Add().Titled("Actions").Encoded(false).Sanitized(false).RenderValueAs(m => RenderActions(m));
          }).WithPaging(20)


  
}
else
{
    <p> There are no integrations found in the Database</p>
    <p>
        @Html.ActionLink("Create New Integration", "CreateIntegration", "Integration")
    </p>
}